package com.example.demo.mapper;

import com.example.demo.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @创建人: ZS
 * @创建时间: 2021/4/2
 * @描述:
 */
@Mapper
public interface MovieMapper {
    @Select("select * from reying")
    List<Movie> findAllRy();
    @Select("select * from shangying")
    List<Movie> findAllSy();
    @Select("select * from yingpian")
    List<Movie> findAllYp();
//    @Select("select m_src from yingpian")
//    List<MovieImg> findAllImg();
    @Select("select * from product")
    List<Product> findAllProduct();
    @Select("select * from list")
    List<Lists> findAllLists();
    @Select("select * from img")
    List<HeaderImg> findImg();
    @Select("select * from reying limit #{page},12")
    List<Movie> queryMoviesRy(int page);
    @Select("select * from shangying limit #{page},12")
    List<Movie> queryMoviesSy(int page);
    @Select("select * from yingpian limit #{page},12")
    List<Movie> queryMoviesYp(int page);
    @Select("select * from reying where m_id=#{id}")
    List<Movie> findMovieRy(int id);
    @Select("select * from shangying where m_id=#{id}")
    List<Movie> findMovieSy(int id);
    @Select("select * from yingpian where m_id=#{id}")
    List<Movie> findMovieYp(int id);
    @Select("select * from movie where m_id=#{id}")
    List<Movie> findMovie(int id);
    @Select("select * from movie where m_name like '%${name}%'")
    List<Movie> searchMovie(String name);
}
